#!/bin/bash
set -e
echo "[远程] 开始为 appexecel2student 进行部署..."
cd /bak/tar
echo "[远程] 从 tar 文件加载 Docker 镜像..."
docker load -i appexecel2student.tar
echo "[远程] 停止并移除旧容器..."
docker stop appexecel2student 2>&1 || true
docker rm appexecel2student 2>&1 || true
echo "[远程] 清理旧镜像..."
docker image prune -f 2>&1 || true
echo "[远程] 使用预设命令启动新容器..."
docker run -d   --name appexecel2student   -p 7661:3000   -p 7662:80   --network=mynet   --restart unless-stopped   appexecel2student
echo "[远程] 部署完成！"
docker ps | grep appexecel2student
